home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1998 November / Freeware November 1998.img / dist / fw_elisp-manual-19.idb / usr / freeware / info / elisp-3.z / elisp-3 (.txt)
GNU Info File  |  1998-05-26  |  51KB  |  949 lines

  1. This is Info file elisp, produced by Makeinfo-1.63 from the input file
  2. elisp.texi.
  3.    This version is the edition 2.4.2 of the GNU Emacs Lisp Reference
  4. Manual.  It corresponds to Emacs Version 19.34.
  5.    Published by the Free Software Foundation 59 Temple Place, Suite 330
  6. Boston, MA  02111-1307  USA
  7.    Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996 Free Software
  8. Foundation, Inc.
  9.    Permission is granted to make and distribute verbatim copies of this
  10. manual provided the copyright notice and this permission notice are
  11. preserved on all copies.
  12.    Permission is granted to copy and distribute modified versions of
  13. this manual under the conditions for verbatim copying, provided that the
  14. entire resulting derived work is distributed under the terms of a
  15. permission notice identical to this one.
  16.    Permission is granted to copy and distribute translations of this
  17. manual into another language, under the above conditions for modified
  18. versions, except that this permission notice may be stated in a
  19. translation approved by the Foundation.
  20.    Permission is granted to copy and distribute modified versions of
  21. this manual under the conditions for verbatim copying, provided also
  22. that the section entitled "GNU General Public License" is included
  23. exactly as in the original, and provided that the entire resulting
  24. derived work is distributed under the terms of a permission notice
  25. identical to this one.
  26.    Permission is granted to copy and distribute translations of this
  27. manual into another language, under the above conditions for modified
  28. versions, except that the section entitled "GNU General Public License"
  29. may be included in a translation approved by the Free Software
  30. Foundation instead of in the original English.
  31. File: elisp,  Node: Character Type,  Next: Symbol Type,  Prev: Floating Point Type,  Up: Programming Types
  32. Character Type
  33. --------------
  34.    A "character" in Emacs Lisp is nothing more than an integer.  In
  35. other words, characters are represented by their character codes.  For
  36. example, the character `A' is represented as the integer 65.
  37.    Individual characters are not often used in programs.  It is far more
  38. common to work with *strings*, which are sequences composed of
  39. characters.  *Note String Type::.
  40.    Characters in strings, buffers, and files are currently limited to
  41. the range of 0 to 255--eight bits.  If you store a larger integer into a
  42. string, buffer or file, it is truncated to that range.  Characters that
  43. represent keyboard input have a much wider range.
  44.    Since characters are really integers, the printed representation of a
  45. character is a decimal number.  This is also a possible read syntax for
  46. a character, but writing characters that way in Lisp programs is a very
  47. bad idea.  You should *always* use the special read syntax formats that
  48. Emacs Lisp provides for characters.  These syntax formats start with a
  49. question mark.
  50.    The usual read syntax for alphanumeric characters is a question mark
  51. followed by the character; thus, `?A' for the character `A', `?B' for
  52. the character `B', and `?a' for the character `a'.
  53.    For example:
  54.      ?Q => 81     ?q => 113
  55.    You can use the same syntax for punctuation characters, but it is
  56. often a good idea to add a `\' so that the Emacs commands for editing
  57. Lisp code don't get confused.  For example, `?\ ' is the way to write
  58. the space character.  If the character is `\', you *must* use a second
  59. `\' to quote it: `?\\'.
  60.    You can express the characters Control-g, backspace, tab, newline,
  61. vertical tab, formfeed, return, and escape as `?\a', `?\b', `?\t',
  62. `?\n', `?\v', `?\f', `?\r', `?\e', respectively.  Those values are 7,
  63. 8, 9, 10, 11, 12, 13, and 27 in decimal.  Thus,
  64.      ?\a => 7                 ; `C-g'
  65.      ?\b => 8                 ; backspace, BS, `C-h'
  66.      ?\t => 9                 ; tab, TAB, `C-i'
  67.      ?\n => 10                ; newline, LFD, `C-j'
  68.      ?\v => 11                ; vertical tab, `C-k'
  69.      ?\f => 12                ; formfeed character, `C-l'
  70.      ?\r => 13                ; carriage return, RET, `C-m'
  71.      ?\e => 27                ; escape character, ESC, `C-['
  72.      ?\\ => 92                ; backslash character, `\'
  73.    These sequences which start with backslash are also known as "escape
  74. sequences", because backslash plays the role of an escape character;
  75. this usage has nothing to do with the character ESC.
  76.    Control characters may be represented using yet another read syntax.
  77. This consists of a question mark followed by a backslash, caret, and the
  78. corresponding non-control character, in either upper or lower case.  For
  79. example, both `?\^I' and `?\^i' are valid read syntax for the character
  80. `C-i', the character whose value is 9.
  81.    Instead of the `^', you can use `C-'; thus, `?\C-i' is equivalent to
  82. `?\^I' and to `?\^i':
  83.      ?\^I => 9     ?\C-I => 9
  84.    For use in strings and buffers, you are limited to the control
  85. characters that exist in ASCII, but for keyboard input purposes, you
  86. can turn any character into a control character with `C-'.  The
  87. character codes for these non-ASCII control characters include the 2**26
  88. bit as well as the code for the corresponding non-control character.
  89. Ordinary terminals have no way of generating non-ASCII control
  90. characters, but you can generate them straightforwardly using an X
  91. terminal.
  92.    For historical reasons, Emacs treats the DEL character as the
  93. control equivalent of `?':
  94.      ?\^? => 127     ?\C-? => 127
  95. As a result, it is currently not possible to represent the character
  96. `Control-?', which is a meaningful input character under X.  It is not
  97. easy to change this as various Lisp files refer to DEL in this way.
  98.    For representing control characters to be found in files or strings,
  99. we recommend the `^' syntax; for control characters in keyboard input,
  100. we prefer the `C-' syntax.  This does not affect the meaning of the
  101. program, but may guide the understanding of people who read it.
  102.    A "meta character" is a character typed with the META modifier key.
  103. The integer that represents such a character has the 2**27 bit set
  104. (which on most machines makes it a negative number).  We use high bits
  105. for this and other modifiers to make possible a wide range of basic
  106. character codes.
  107.    In a string, the 2**7 bit indicates a meta character, so the meta
  108. characters that can fit in a string have codes in the range from 128 to
  109. 255, and are the meta versions of the ordinary ASCII characters.  (In
  110. Emacs versions 18 and older, this convention was used for characters
  111. outside of strings as well.)
  112.    The read syntax for meta characters uses `\M-'.  For example,
  113. `?\M-A' stands for `M-A'.  You can use `\M-' together with octal
  114. character codes (see below), with `\C-', or with any other syntax for a
  115. character.  Thus, you can write `M-A' as `?\M-A', or as `?\M-\101'.
  116. Likewise, you can write `C-M-b' as `?\M-\C-b', `?\C-\M-b', or
  117. `?\M-\002'.
  118.    The case of an ordinary letter is indicated by its character code as
  119. part of ASCII, but ASCII has no way to represent whether a control
  120. character is upper case or lower case.  Emacs uses the 2**25 bit to
  121. indicate that the shift key was used for typing a control character.
  122. This distinction is possible only when you use X terminals or other
  123. special terminals; ordinary terminals do not indicate the distinction
  124. to the computer in any way.
  125.    The X Window System defines three other modifier bits that can be set
  126. in a character: "hyper", "super" and "alt".  The syntaxes for these
  127. bits are `\H-', `\s-' and `\A-'.  Thus, `?\H-\M-\A-x' represents
  128. `Alt-Hyper-Meta-x'.  Numerically, the bit values are 2**22 for alt,
  129. 2**23 for super and 2**24 for hyper.
  130.    Finally, the most general read syntax consists of a question mark
  131. followed by a backslash and the character code in octal (up to three
  132. octal digits); thus, `?\101' for the character `A', `?\001' for the
  133. character `C-a', and `?\002' for the character `C-b'.  Although this
  134. syntax can represent any ASCII character, it is preferred only when the
  135. precise octal value is more important than the ASCII representation.
  136.      ?\012 => 10         ?\n => 10         ?\C-j => 10
  137.      ?\101 => 65         ?A => 65
  138.    A backslash is allowed, and harmless, preceding any character without
  139. a special escape meaning; thus, `?\+' is equivalent to `?+'.  There is
  140. no reason to add a backslash before most characters.  However, you
  141. should add a backslash before any of the characters `()\|;'`"#.,' to
  142. avoid confusing the Emacs commands for editing Lisp code.  Also add a
  143. backslash before whitespace characters such as space, tab, newline and
  144. formfeed.  However, it is cleaner to use one of the easily readable
  145. escape sequences, such as `\t', instead of an actual whitespace
  146. character such as a tab.
  147. File: elisp,  Node: Symbol Type,  Next: Sequence Type,  Prev: Character Type,  Up: Programming Types
  148. Symbol Type
  149. -----------
  150.    A "symbol" in GNU Emacs Lisp is an object with a name.  The symbol
  151. name serves as the printed representation of the symbol.  In ordinary
  152. use, the name is unique--no two symbols have the same name.
  153.    A symbol can serve as a variable, as a function name, or to hold a
  154. property list.  Or it may serve only to be distinct from all other Lisp
  155. objects, so that its presence in a data structure may be recognized
  156. reliably.  In a given context, usually only one of these uses is
  157. intended.  But you can use one symbol in all of these ways,
  158. independently.
  159.    A symbol name can contain any characters whatever.  Most symbol names
  160. are written with letters, digits, and the punctuation characters
  161. `-+=*/'.  Such names require no special punctuation; the characters of
  162. the name suffice as long as the name does not look like a number.  (If
  163. it does, write a `\' at the beginning of the name to force
  164. interpretation as a symbol.)  The characters `_~!@$%^&:<>{}' are less
  165. often used but also require no special punctuation.  Any other
  166. characters may be included in a symbol's name by escaping them with a
  167. backslash.  In contrast to its use in strings, however, a backslash in
  168. the name of a symbol simply quotes the single character that follows the
  169. backslash.  For example, in a string, `\t' represents a tab character;
  170. in the name of a symbol, however, `\t' merely quotes the letter `t'.
  171. To have a symbol with a tab character in its name, you must actually
  172. use a tab (preceded with a backslash).  But it's rare to do such a
  173. thing.
  174.      Common Lisp note: In Common Lisp, lower case letters are always
  175.      "folded" to upper case, unless they are explicitly escaped.  In
  176.      Emacs Lisp, upper case and lower case letters are distinct.
  177.    Here are several examples of symbol names.  Note that the `+' in the
  178. fifth example is escaped to prevent it from being read as a number.
  179. This is not necessary in the sixth example because the rest of the name
  180. makes it invalid as a number.
  181.      foo                 ; A symbol named `foo'.
  182.      FOO                 ; A symbol named `FOO', different from `foo'.
  183.      char-to-string      ; A symbol named `char-to-string'.
  184.      1+                  ; A symbol named `1+'
  185.                          ;   (not `+1', which is an integer).
  186.      \+1                 ; A symbol named `+1'
  187.                          ;   (not a very readable name).
  188.      \(*\ 1\ 2\)         ; A symbol named `(* 1 2)' (a worse name).
  189.      +-*/_~!@$%^&=:<>{}  ; A symbol named `+-*/_~!@$%^&=:<>{}'.
  190.                          ;   These characters need not be escaped.
  191. File: elisp,  Node: Sequence Type,  Next: Cons Cell Type,  Prev: Symbol Type,  Up: Programming Types
  192. Sequence Types
  193. --------------
  194.    A "sequence" is a Lisp object that represents an ordered set of
  195. elements.  There are two kinds of sequence in Emacs Lisp, lists and
  196. arrays.  Thus, an object of type list or of type array is also
  197. considered a sequence.
  198.    Arrays are further subdivided into strings and vectors.  Vectors can
  199. hold elements of any type, but string elements must be characters in the
  200. range from 0 to 255.  However, the characters in a string can have text
  201. properties like characters in a buffer (*note Text Properties::.);
  202. vectors do not support text properties even when their elements happen
  203. to be characters.
  204.    Lists, strings and vectors are different, but they have important
  205. similarities.  For example, all have a length L, and all have elements
  206. which can be indexed from zero to L minus one.  Also, several
  207. functions, called sequence functions, accept any kind of sequence.  For
  208. example, the function `elt' can be used to extract an element of a
  209. sequence, given its index.  *Note Sequences Arrays Vectors::.
  210.    It is impossible to read the same sequence twice, since sequences are
  211. always created anew upon reading.  If you read the read syntax for a
  212. sequence twice, you get two sequences with equal contents.  There is one
  213. exception: the empty list `()' always stands for the same object, `nil'.
  214. File: elisp,  Node: Cons Cell Type,  Next: Array Type,  Prev: Sequence Type,  Up: Programming Types
  215. Cons Cell and List Types
  216. ------------------------
  217.    A "cons cell" is an object comprising two pointers named the CAR and
  218. the CDR.  Each of them can point to any Lisp object.
  219.    A "list" is a series of cons cells, linked together so that the CDR
  220. of each cons cell points either to another cons cell or to the empty
  221. list.  *Note Lists::, for functions that work on lists.  Because most
  222. cons cells are used as part of lists, the phrase "list structure" has
  223. come to refer to any structure made out of cons cells.
  224.    The names CAR and CDR have only historical meaning now.  The
  225. original Lisp implementation ran on an IBM 704 computer which divided
  226. words into two parts, called the "address" part and the "decrement";
  227. CAR was an instruction to extract the contents of the address part of a
  228. register, and CDR an instruction to extract the contents of the
  229. decrement.  By contrast, "cons cells" are named for the function `cons'
  230. that creates them, which in turn is named for its purpose, the
  231. construction of cells.
  232.    Because cons cells are so central to Lisp, we also have a word for
  233. "an object which is not a cons cell".  These objects are called "atoms".
  234.    The read syntax and printed representation for lists are identical,
  235. and consist of a left parenthesis, an arbitrary number of elements, and
  236. a right parenthesis.
  237.    Upon reading, each object inside the parentheses becomes an element
  238. of the list.  That is, a cons cell is made for each element.  The CAR
  239. of the cons cell points to the element, and its CDR points to the next
  240. cons cell of the list, which holds the next element in the list.  The
  241. CDR of the last cons cell is set to point to `nil'.
  242.    A list can be illustrated by a diagram in which the cons cells are
  243. shown as pairs of boxes.  (The Lisp reader cannot read such an
  244. illustration; unlike the textual notation, which can be understood by
  245. both humans and computers, the box illustrations can be understood only
  246. by humans.)  The following represents the three-element list `(rose
  247. violet buttercup)':
  248.          ___ ___      ___ ___      ___ ___
  249.         |___|___|--> |___|___|--> |___|___|--> nil
  250.           |            |            |
  251.           |            |            |
  252.            --> rose     --> violet   --> buttercup
  253.    In this diagram, each box represents a slot that can refer to any
  254. Lisp object.  Each pair of boxes represents a cons cell.  Each arrow is
  255. a reference to a Lisp object, either an atom or another cons cell.
  256.    In this example, the first box, the CAR of the first cons cell,
  257. refers to or "contains" `rose' (a symbol).  The second box, the CDR of
  258. the first cons cell, refers to the next pair of boxes, the second cons
  259. cell.  The CAR of the second cons cell refers to `violet' and the CDR
  260. refers to the third cons cell.  The CDR of the third (and last) cons
  261. cell refers to `nil'.
  262.    Here is another diagram of the same list, `(rose violet buttercup)',
  263. sketched in a different manner:
  264.      ---------------       ----------------       -------------------
  265.      | car   | cdr   |     | car    | cdr   |     | car       | cdr   |
  266.      | rose  |   o-------->| violet |   o-------->| buttercup |  nil  |
  267.      |       |       |     |        |       |     |           |       |
  268.       ---------------       ----------------       -------------------
  269.    A list with no elements in it is the "empty list"; it is identical
  270. to the symbol `nil'.  In other words, `nil' is both a symbol and a list.
  271.    Here are examples of lists written in Lisp syntax:
  272.      (A 2 "A")            ; A list of three elements.
  273.      ()                   ; A list of no elements (the empty list).
  274.      nil                  ; A list of no elements (the empty list).
  275.      ("A ()")             ; A list of one element: the string `"A ()"'.
  276.      (A ())               ; A list of two elements: `A' and the empty list.
  277.      (A nil)              ; Equivalent to the previous.
  278.      ((A B C))            ; A list of one element
  279.                           ;   (which is a list of three elements).
  280.    Here is the list `(A ())', or equivalently `(A nil)', depicted with
  281. boxes and arrows:
  282.          ___ ___      ___ ___
  283.         |___|___|--> |___|___|--> nil
  284.           |            |
  285.           |            |
  286.            --> A        --> nil
  287. * Menu:
  288. * Dotted Pair Notation::        An alternative syntax for lists.
  289. * Association List Type::       A specially constructed list.
  290. File: elisp,  Node: Dotted Pair Notation,  Next: Association List Type,  Up: Cons Cell Type
  291. Dotted Pair Notation
  292. ....................
  293.    "Dotted pair notation" is an alternative syntax for cons cells that
  294. represents the CAR and CDR explicitly.  In this syntax, `(A . B)'
  295. stands for a cons cell whose CAR is the object A, and whose CDR is the
  296. object B.  Dotted pair notation is therefore more general than list
  297. syntax.  In the dotted pair notation, the list `(1 2 3)' is written as
  298. `(1 .  (2 . (3 . nil)))'.  For `nil'-terminated lists, the two
  299. notations produce the same result, but list notation is usually clearer
  300. and more convenient when it is applicable.  When printing a list, the
  301. dotted pair notation is only used if the CDR of a cell is not a list.
  302.    Here's how box notation can illustrate dotted pairs.  This example
  303. shows the pair `(rose . violet)':
  304.          ___ ___
  305.         |___|___|--> violet
  306.           |
  307.           |
  308.            --> rose
  309.    Dotted pair notation can be combined with list notation to represent
  310. a chain of cons cells with a non-`nil' final CDR.  For example, `(rose
  311. violet . buttercup)' is equivalent to `(rose . (violet . buttercup))'.
  312. The object looks like this:
  313.          ___ ___      ___ ___
  314.         |___|___|--> |___|___|--> buttercup
  315.           |            |
  316.           |            |
  317.            --> rose     --> violet
  318.    These diagrams make it evident why `(rose . violet . buttercup)' is
  319. invalid syntax; it would require a cons cell that has three parts
  320. rather than two.
  321.    The list `(rose violet)' is equivalent to `(rose . (violet))' and
  322. looks like this:
  323.          ___ ___      ___ ___
  324.         |___|___|--> |___|___|--> nil
  325.           |            |
  326.           |            |
  327.            --> rose     --> violet
  328.    Similarly, the three-element list `(rose violet buttercup)' is
  329. equivalent to `(rose . (violet . (buttercup)))'.  It looks like this:
  330.          ___ ___      ___ ___      ___ ___
  331.         |___|___|--> |___|___|--> |___|___|--> nil
  332.           |            |            |
  333.           |            |            |
  334.            --> rose     --> violet   --> buttercup
  335. File: elisp,  Node: Association List Type,  Prev: Dotted Pair Notation,  Up: Cons Cell Type
  336. Association List Type
  337. .....................
  338.    An "association list" or "alist" is a specially-constructed list
  339. whose elements are cons cells.  In each element, the CAR is considered
  340. a "key", and the CDR is considered an "associated value".  (In some
  341. cases, the associated value is stored in the CAR of the CDR.)
  342. Association lists are often used as stacks, since it is easy to add or
  343. remove associations at the front of the list.
  344.    For example,
  345.      (setq alist-of-colors
  346.            '((rose . red) (lily . white)  (buttercup . yellow)))
  347. sets the variable `alist-of-colors' to an alist of three elements.  In
  348. the first element, `rose' is the key and `red' is the value.
  349.    *Note Association Lists::, for a further explanation of alists and
  350. for functions that work on alists.
  351. File: elisp,  Node: Array Type,  Next: String Type,  Prev: Cons Cell Type,  Up: Programming Types
  352. Array Type
  353. ----------
  354.    An "array" is composed of an arbitrary number of slots for referring
  355. to other Lisp objects, arranged in a contiguous block of memory.
  356. Accessing any element of an array takes the same amount of time.  In
  357. contrast, accessing an element of a list requires time proportional to
  358. the position of the element in the list.  (Elements at the end of a
  359. list take longer to access than elements at the beginning of a list.)
  360.    Emacs defines two types of array, strings and vectors.  A string is
  361. an array of characters and a vector is an array of arbitrary objects.
  362. Both are one-dimensional.  (Most other programming languages support
  363. multidimensional arrays, but they are not essential; you can get the
  364. same effect with an array of arrays.)  Each type of array has its own
  365. read syntax; see *Note String Type::, and *Note Vector Type::.
  366.    An array may have any length up to the largest integer; but once
  367. created, it has a fixed size.  The first element of an array has index
  368. zero, the second element has index 1, and so on.  This is called
  369. "zero-origin" indexing.  For example, an array of four elements has
  370. indices 0, 1, 2, and 3.
  371.    The array type is contained in the sequence type and contains both
  372. the string type and the vector type.
  373. File: elisp,  Node: String Type,  Next: Vector Type,  Prev: Array Type,  Up: Programming Types
  374. String Type
  375. -----------
  376.    A "string" is an array of characters.  Strings are used for many
  377. purposes in Emacs, as can be expected in a text editor; for example, as
  378. the names of Lisp symbols, as messages for the user, and to represent
  379. text extracted from buffers.  Strings in Lisp are constants: evaluation
  380. of a string returns the same string.
  381.    The read syntax for strings is a double-quote, an arbitrary number of
  382. characters, and another double-quote, `"like this"'.  The Lisp reader
  383. accepts the same formats for reading the characters of a string as it
  384. does for reading single characters (without the question mark that
  385. begins a character literal).  You can enter a nonprinting character such
  386. as tab, `C-a' or `M-C-A' using the convenient escape sequences, like
  387. this: `"\t, \C-a, \M-\C-a"'.  You can include a double-quote in a
  388. string by preceding it with a backslash; thus, `"\""' is a string
  389. containing just a single double-quote character.  (*Note Character
  390. Type::, for a description of the read syntax for characters.)
  391.    If you use the `\M-' syntax to indicate a meta character in a string
  392. constant, this sets the 2**7 bit of the character in the string.  This
  393. is not the same representation that the meta modifier has in a
  394. character on its own (not inside a string).  *Note Character Type::.
  395.    Strings cannot hold characters that have the hyper, super, or alt
  396. modifiers; they can hold ASCII control characters, but no others.  They
  397. do not distinguish case in ASCII control characters.
  398.    The printed representation of a string consists of a double-quote,
  399. the characters it contains, and another double-quote.  However, you must
  400. escape any backslash or double-quote characters in the string with a
  401. backslash, like this: `"this \" is an embedded quote"'.
  402.    The newline character is not special in the read syntax for strings;
  403. if you write a new line between the double-quotes, it becomes a
  404. character in the string.  But an escaped newline--one that is preceded
  405. by `\'--does not become part of the string; i.e., the Lisp reader
  406. ignores an escaped newline while reading a string.
  407.      "It is useful to include newlines
  408.      in documentation strings,
  409.      but the newline is \
  410.      ignored if escaped."
  411.           => "It is useful to include newlines
  412.      in documentation strings,
  413.      but the newline is ignored if escaped."
  414.    A string can hold properties of the text it contains, in addition to
  415. the characters themselves.  This enables programs that copy text between
  416. strings and buffers to preserve the properties with no special effort.
  417. *Note Text Properties::.  Strings with text properties have a special
  418. read and print syntax:
  419.      #("CHARACTERS" PROPERTY-DATA...)
  420. where PROPERTY-DATA consists of zero or more elements, in groups of
  421. three as follows:
  422.      BEG END PLIST
  423. The elements BEG and END are integers, and together specify a range of
  424. indices in the string; PLIST is the property list for that range.
  425.    *Note Strings and Characters::, for functions that work on strings.
  426. File: elisp,  Node: Vector Type,  Next: Function Type,  Prev: String Type,  Up: Programming Types
  427. Vector Type
  428. -----------
  429.    A "vector" is a one-dimensional array of elements of any type.  It
  430. takes a constant amount of time to access any element of a vector.  (In
  431. a list, the access time of an element is proportional to the distance of
  432. the element from the beginning of the list.)
  433.    The printed representation of a vector consists of a left square
  434. bracket, the elements, and a right square bracket.  This is also the
  435. read syntax.  Like numbers and strings, vectors are considered constants
  436. for evaluation.
  437.      [1 "two" (three)]      ; A vector of three elements.
  438.           => [1 "two" (three)]
  439.    *Note Vectors::, for functions that work with vectors.
  440. File: elisp,  Node: Function Type,  Next: Macro Type,  Prev: Vector Type,  Up: Programming Types
  441. Function Type
  442. -------------
  443.    Just as functions in other programming languages are executable,
  444. "Lisp function" objects are pieces of executable code.  However,
  445. functions in Lisp are primarily Lisp objects, and only secondarily the
  446. text which represents them.  These Lisp objects are lambda expressions:
  447. lists whose first element is the symbol `lambda' (*note Lambda
  448. Expressions::.).
  449.    In most programming languages, it is impossible to have a function
  450. without a name.  In Lisp, a function has no intrinsic name.  A lambda
  451. expression is also called an "anonymous function" (*note Anonymous
  452. Functions::.).  A named function in Lisp is actually a symbol with a
  453. valid function in its function cell (*note Defining Functions::.).
  454.    Most of the time, functions are called when their names are written
  455. in Lisp expressions in Lisp programs.  However, you can construct or
  456. obtain a function object at run time and then call it with the primitive
  457. functions `funcall' and `apply'.  *Note Calling Functions::.
  458. File: elisp,  Node: Macro Type,  Next: Primitive Function Type,  Prev: Function Type,  Up: Programming Types
  459. Macro Type
  460. ----------
  461.    A "Lisp macro" is a user-defined construct that extends the Lisp
  462. language.  It is represented as an object much like a function, but with
  463. different parameter-passing semantics.  A Lisp macro has the form of a
  464. list whose first element is the symbol `macro' and whose CDR is a Lisp
  465. function object, including the `lambda' symbol.
  466.    Lisp macro objects are usually defined with the built-in `defmacro'
  467. function, but any list that begins with `macro' is a macro as far as
  468. Emacs is concerned.  *Note Macros::, for an explanation of how to write
  469. a macro.
  470. File: elisp,  Node: Primitive Function Type,  Next: Byte-Code Type,  Prev: Macro Type,  Up: Programming Types
  471. Primitive Function Type
  472. -----------------------
  473.    A "primitive function" is a function callable from Lisp but written
  474. in the C programming language.  Primitive functions are also called
  475. "subrs" or "built-in functions".  (The word "subr" is derived from
  476. "subroutine".)  Most primitive functions evaluate all their arguments
  477. when they are called.  A primitive function that does not evaluate all
  478. its arguments is called a "special form" (*note Special Forms::.).
  479.    It does not matter to the caller of a function whether the function
  480. is primitive.  However, this does matter if you try to substitute a
  481. function written in Lisp for a primitive of the same name.  The reason
  482. is that the primitive function may be called directly from C code.
  483. Calls to the redefined function from Lisp will use the new definition,
  484. but calls from C code may still use the built-in definition.
  485.    The term "function" refers to all Emacs functions, whether written
  486. in Lisp or C.  *Note Function Type::, for information about the
  487. functions written in Lisp.
  488.    Primitive functions have no read syntax and print in hash notation
  489. with the name of the subroutine.
  490.      (symbol-function 'car)          ; Access the function cell
  491.                                      ;   of the symbol.
  492.           => #<subr car>
  493.      (subrp (symbol-function 'car))  ; Is this a primitive function?
  494.           => t                       ; Yes.
  495. File: elisp,  Node: Byte-Code Type,  Next: Autoload Type,  Prev: Primitive Function Type,  Up: Programming Types
  496. Byte-Code Function Type
  497. -----------------------
  498.    The byte compiler produces "byte-code function objects".
  499. Internally, a byte-code function object is much like a vector; however,
  500. the evaluator handles this data type specially when it appears as a
  501. function to be called.  *Note Byte Compilation::, for information about
  502. the byte compiler.
  503.    The printed representation and read syntax for a byte-code function
  504. object is like that for a vector, with an additional `#' before the
  505. opening `['.
  506. File: elisp,  Node: Autoload Type,  Prev: Byte-Code Type,  Up: Programming Types
  507. Autoload Type
  508. -------------
  509.    An "autoload object" is a list whose first element is the symbol
  510. `autoload'.  It is stored as the function definition of a symbol as a
  511. placeholder for the real definition; it says that the real definition
  512. is found in a file of Lisp code that should be loaded when necessary.
  513. The autoload object contains the name of the file, plus some other
  514. information about the real definition.
  515.    After the file has been loaded, the symbol should have a new function
  516. definition that is not an autoload object.  The new definition is then
  517. called as if it had been there to begin with.  From the user's point of
  518. view, the function call works as expected, using the function definition
  519. in the loaded file.
  520.    An autoload object is usually created with the function `autoload',
  521. which stores the object in the function cell of a symbol.  *Note
  522. Autoload::, for more details.
  523. File: elisp,  Node: Editing Types,  Next: Type Predicates,  Prev: Programming Types,  Up: Lisp Data Types
  524. Editing Types
  525. =============
  526.    The types in the previous section are common to many Lisp dialects.
  527. Emacs Lisp provides several additional data types for purposes connected
  528. with editing.
  529. * Menu:
  530. * Buffer Type::         The basic object of editing.
  531. * Marker Type::         A position in a buffer.
  532. * Window Type::         Buffers are displayed in windows.
  533. * Frame Type::        Windows subdivide frames.
  534. * Window Configuration Type::   Recording the way a frame is subdivided.
  535. * Process Type::        A process running on the underlying OS.
  536. * Stream Type::         Receive or send characters.
  537. * Keymap Type::         What function a keystroke invokes.
  538. * Syntax Table Type::   What a character means.
  539. * Display Table Type::  How display tables are represented.
  540. * Overlay Type::        How an overlay is represented.
  541. File: elisp,  Node: Buffer Type,  Next: Marker Type,  Up: Editing Types
  542. Buffer Type
  543. -----------
  544.    A "buffer" is an object that holds text that can be edited (*note
  545. Buffers::.).  Most buffers hold the contents of a disk file (*note
  546. Files::.) so they can be edited, but some are used for other purposes.
  547. Most buffers are also meant to be seen by the user, and therefore
  548. displayed, at some time, in a window (*note Windows::.).  But a buffer
  549. need not be displayed in any window.
  550.    The contents of a buffer are much like a string, but buffers are not
  551. used like strings in Emacs Lisp, and the available operations are
  552. different.  For example, insertion of text into a buffer is very
  553. efficient, whereas "inserting" text into a string requires
  554. concatenating substrings, and the result is an entirely new string
  555. object.
  556.    Each buffer has a designated position called "point" (*note
  557. Positions::.).  At any time, one buffer is the "current buffer".  Most
  558. editing commands act on the contents of the current buffer in the
  559. neighborhood of point.  Many of the standard Emacs functions manipulate
  560. or test the characters in the current buffer; a whole chapter in this
  561. manual is devoted to describing these functions (*note Text::.).
  562.    Several other data structures are associated with each buffer:
  563.    * a local syntax table (*note Syntax Tables::.);
  564.    * a local keymap (*note Keymaps::.); and,
  565.    * a local variable binding list (*note Buffer-Local Variables::.).
  566.    * a list of overlays (*note Overlays::.).
  567.    * text properties for the text in the buffer (*note Text
  568.      Properties::.).
  569. The local keymap and variable list contain entries that individually
  570. override global bindings or values.  These are used to customize the
  571. behavior of programs in different buffers, without actually changing the
  572. programs.
  573.    A buffer may be "indirect", which means it shares the text of
  574. another buffer.  *Note Indirect Buffers::.
  575.    Buffers have no read syntax.  They print in hash notation, showing
  576. the buffer name.
  577.      (current-buffer)
  578.           => #<buffer objects.texi>
  579. File: elisp,  Node: Marker Type,  Next: Window Type,  Prev: Buffer Type,  Up: Editing Types
  580. Marker Type
  581. -----------
  582.    A "marker" denotes a position in a specific buffer.  Markers
  583. therefore have two components: one for the buffer, and one for the
  584. position.  Changes in the buffer's text automatically relocate the
  585. position value as necessary to ensure that the marker always points
  586. between the same two characters in the buffer.
  587.    Markers have no read syntax.  They print in hash notation, giving the
  588. current character position and the name of the buffer.
  589.      (point-marker)
  590.           => #<marker at 10779 in objects.texi>
  591.    *Note Markers::, for information on how to test, create, copy, and
  592. move markers.
  593. File: elisp,  Node: Window Type,  Next: Frame Type,  Prev: Marker Type,  Up: Editing Types
  594. Window Type
  595. -----------
  596.    A "window" describes the portion of the terminal screen that Emacs
  597. uses to display a buffer.  Every window has one associated buffer, whose
  598. contents appear in the window.  By contrast, a given buffer may appear
  599. in one window, no window, or several windows.
  600.    Though many windows may exist simultaneously, at any time one window
  601. is designated the "selected window".  This is the window where the
  602. cursor is (usually) displayed when Emacs is ready for a command.  The
  603. selected window usually displays the current buffer, but this is not
  604. necessarily the case.
  605.    Windows are grouped on the screen into frames; each window belongs to
  606. one and only one frame.  *Note Frame Type::.
  607.    Windows have no read syntax.  They print in hash notation, giving the
  608. window number and the name of the buffer being displayed.  The window
  609. numbers exist to identify windows uniquely, since the buffer displayed
  610. in any given window can change frequently.
  611.      (selected-window)
  612.           => #<window 1 on objects.texi>
  613.    *Note Windows::, for a description of the functions that work on
  614. windows.
  615. File: elisp,  Node: Frame Type,  Next: Window Configuration Type,  Prev: Window Type,  Up: Editing Types
  616. Frame Type
  617. ----------
  618.    A FRAME is a rectangle on the screen that contains one or more Emacs
  619. windows.  A frame initially contains a single main window (plus perhaps
  620. a minibuffer window) which you can subdivide vertically or horizontally
  621. into smaller windows.
  622.    Frames have no read syntax.  They print in hash notation, giving the
  623. frame's title, plus its address in core (useful to identify the frame
  624. uniquely).
  625.      (selected-frame)
  626.           => #<frame xemacs@mole.gnu.ai.mit.edu 0xdac80>
  627.    *Note Frames::, for a description of the functions that work on
  628. frames.
  629. File: elisp,  Node: Window Configuration Type,  Next: Process Type,  Prev: Frame Type,  Up: Editing Types
  630. Window Configuration Type
  631. -------------------------
  632.    A "window configuration" stores information about the positions,
  633. sizes, and contents of the windows in a frame, so you can recreate the
  634. same arrangement of windows later.
  635.    Window configurations do not have a read syntax; their print syntax
  636. looks like `#<window-configuration>'.  *Note Window Configurations::,
  637. for a description of several functions related to window configurations.
  638. File: elisp,  Node: Process Type,  Next: Stream Type,  Prev: Window Configuration Type,  Up: Editing Types
  639. Process Type
  640. ------------
  641.    The word "process" usually means a running program.  Emacs itself
  642. runs in a process of this sort.  However, in Emacs Lisp, a process is a
  643. Lisp object that designates a subprocess created by the Emacs process.
  644. Programs such as shells, GDB, ftp, and compilers, running in
  645. subprocesses of Emacs, extend the capabilities of Emacs.
  646.    An Emacs subprocess takes textual input from Emacs and returns
  647. textual output to Emacs for further manipulation.  Emacs can also send
  648. signals to the subprocess.
  649.    Process objects have no read syntax.  They print in hash notation,
  650. giving the name of the process:
  651.      (process-list)
  652.           => (#<process shell>)
  653.    *Note Processes::, for information about functions that create,
  654. delete, return information about, send input or signals to, and receive
  655. output from processes.
  656. File: elisp,  Node: Stream Type,  Next: Keymap Type,  Prev: Process Type,  Up: Editing Types
  657. Stream Type
  658. -----------
  659.    A "stream" is an object that can be used as a source or sink for
  660. characters--either to supply characters for input or to accept them as
  661. output.  Many different types can be used this way: markers, buffers,
  662. strings, and functions.  Most often, input streams (character sources)
  663. obtain characters from the keyboard, a buffer, or a file, and output
  664. streams (character sinks) send characters to a buffer, such as a
  665. `*Help*' buffer, or to the echo area.
  666.    The object `nil', in addition to its other meanings, may be used as
  667. a stream.  It stands for the value of the variable `standard-input' or
  668. `standard-output'.  Also, the object `t' as a stream specifies input
  669. using the minibuffer (*note Minibuffers::.) or output in the echo area
  670. (*note The Echo Area::.).
  671.    Streams have no special printed representation or read syntax, and
  672. print as whatever primitive type they are.
  673.    *Note Read and Print::, for a description of functions related to
  674. streams, including parsing and printing functions.
  675. File: elisp,  Node: Keymap Type,  Next: Syntax Table Type,  Prev: Stream Type,  Up: Editing Types
  676. Keymap Type
  677. -----------
  678.    A "keymap" maps keys typed by the user to commands.  This mapping
  679. controls how the user's command input is executed.  A keymap is actually
  680. a list whose CAR is the symbol `keymap'.
  681.    *Note Keymaps::, for information about creating keymaps, handling
  682. prefix keys, local as well as global keymaps, and changing key bindings.
  683. File: elisp,  Node: Syntax Table Type,  Next: Display Table Type,  Prev: Keymap Type,  Up: Editing Types
  684. Syntax Table Type
  685. -----------------
  686.    A "syntax table" is a vector of 256 integers.  Each element of the
  687. vector defines how one character is interpreted when it appears in a
  688. buffer.  For example, in C mode (*note Major Modes::.), the `+'
  689. character is punctuation, but in Lisp mode it is a valid character in a
  690. symbol.  These modes specify different interpretations by changing the
  691. syntax table entry for `+', at index 43 in the syntax table.
  692.    Syntax tables are used only for scanning text in buffers, not for
  693. reading Lisp expressions.  The table the Lisp interpreter uses to read
  694. expressions is built into the Emacs source code and cannot be changed;
  695. thus, to change the list delimiters to be `{' and `}' instead of `('
  696. and `)' would be impossible.
  697.    *Note Syntax Tables::, for details about syntax classes and how to
  698. make and modify syntax tables.
  699. File: elisp,  Node: Display Table Type,  Next: Overlay Type,  Prev: Syntax Table Type,  Up: Editing Types
  700. Display Table Type
  701. ------------------
  702.    A "display table" specifies how to display each character code.
  703. Each buffer and each window can have its own display table.  A display
  704. table is actually a vector of length 262.  *Note Display Tables::.
  705. File: elisp,  Node: Overlay Type,  Prev: Display Table Type,  Up: Editing Types
  706. Overlay Type
  707. ------------
  708.    An "overlay" specifies temporary alteration of the display
  709. appearance of a part of a buffer.  It contains markers delimiting a
  710. range of the buffer, plus a property list (a list whose elements are
  711. alternating property names and values).  Overlays are used to present
  712. parts of the buffer temporarily in a different display style.  They have
  713. no read syntax, and print in hash notation, giving the buffer name and
  714. range of positions.
  715.    *Note Overlays::, for how to create and use overlays.
  716. File: elisp,  Node: Type Predicates,  Next: Equality Predicates,  Prev: Editing Types,  Up: Lisp Data Types
  717. Type Predicates
  718. ===============
  719.    The Emacs Lisp interpreter itself does not perform type checking on
  720. the actual arguments passed to functions when they are called.  It could
  721. not do so, since function arguments in Lisp do not have declared data
  722. types, as they do in other programming languages.  It is therefore up to
  723. the individual function to test whether each actual argument belongs to
  724. a type that the function can use.
  725.    All built-in functions do check the types of their actual arguments
  726. when appropriate, and signal a `wrong-type-argument' error if an
  727. argument is of the wrong type.  For example, here is what happens if you
  728. pass an argument to `+' that it cannot handle:
  729.      (+ 2 'a)
  730.           error--> Wrong type argument: integer-or-marker-p, a
  731.    If you want your program to handle different types differently, you
  732. must do explicit type checking.  The most common way to check the type
  733. of an object is to call a "type predicate" function.  Emacs has a type
  734. predicate for each type, as well as some predicates for combinations of
  735. types.
  736.    A type predicate function takes one argument; it returns `t' if the
  737. argument belongs to the appropriate type, and `nil' otherwise.
  738. Following a general Lisp convention for predicate functions, most type
  739. predicates' names end with `p'.
  740.    Here is an example which uses the predicates `listp' to check for a
  741. list and `symbolp' to check for a symbol.
  742.      (defun add-on (x)
  743.        (cond ((symbolp x)
  744.               ;; If X is a symbol, put it on LIST.
  745.               (setq list (cons x list)))
  746.              ((listp x)
  747.               ;; If X is a list, add its elements to LIST.
  748.               (setq list (append x list)))
  749.              (t
  750.               ;; We only handle symbols and lists.
  751.               (error "Invalid argument %s in add-on" x))))
  752.    Here is a table of predefined type predicates, in alphabetical order,
  753. with references to further information.
  754. `atom'
  755.      *Note atom: List-related Predicates.
  756. `arrayp'
  757.      *Note arrayp: Array Functions.
  758. `bufferp'
  759.      *Note bufferp: Buffer Basics.
  760. `byte-code-function-p'
  761.      *Note byte-code-function-p: Byte-Code Type.
  762. `case-table-p'
  763.      *Note case-table-p: Case Table.
  764. `char-or-string-p'
  765.      *Note char-or-string-p: Predicates for Strings.
  766. `commandp'
  767.      *Note commandp: Interactive Call.
  768. `consp'
  769.      *Note consp: List-related Predicates.
  770. `floatp'
  771.      *Note floatp: Predicates on Numbers.
  772. `frame-live-p'
  773.      *Note frame-live-p: Deleting Frames.
  774. `framep'
  775.      *Note framep: Frames.
  776. `integer-or-marker-p'
  777.      *Note integer-or-marker-p: Predicates on Markers.
  778. `integerp'
  779.      *Note integerp: Predicates on Numbers.
  780. `keymapp'
  781.      *Note keymapp: Creating Keymaps.
  782. `listp'
  783.      *Note listp: List-related Predicates.
  784. `markerp'
  785.      *Note markerp: Predicates on Markers.
  786. `wholenump'
  787.      *Note wholenump: Predicates on Numbers.
  788. `nlistp'
  789.      *Note nlistp: List-related Predicates.
  790. `numberp'
  791.      *Note numberp: Predicates on Numbers.
  792. `number-or-marker-p'
  793.      *Note number-or-marker-p: Predicates on Markers.
  794. `overlayp'
  795.      *Note overlayp: Overlays.
  796. `processp'
  797.      *Note processp: Processes.
  798. `sequencep'
  799.      *Note sequencep: Sequence Functions.
  800. `stringp'
  801.      *Note stringp: Predicates for Strings.
  802. `subrp'
  803.      *Note subrp: Function Cells.
  804. `symbolp'
  805.      *Note symbolp: Symbols.
  806. `syntax-table-p'
  807.      *Note syntax-table-p: Syntax Tables.
  808. `user-variable-p'
  809.      *Note user-variable-p: Defining Variables.
  810. `vectorp'
  811.      *Note vectorp: Vectors.
  812. `window-configuration-p'
  813.      *Note window-configuration-p: Window Configurations.
  814. `window-live-p'
  815.      *Note window-live-p: Deleting Windows.
  816. `windowp'
  817.      *Note windowp: Basic Windows.
  818.    The most general way to check the type of an object is to call the
  819. function `type-of'.  Recall that each object belongs to one and only
  820. one primitive type; `type-of' tells you which one (*note Lisp Data
  821. Types::.).  But `type-of' knows nothing about non-primitive types.  In
  822. most cases, it is more convenient to use type predicates than `type-of'.
  823.  - Function: type-of OBJECT
  824.      This function returns a symbol naming the primitive type of
  825.      OBJECT.  The value is one of the symbols `symbol', `integer',
  826.      `float', `string', `cons', `vector', `marker', `overlay',
  827.      `window', `buffer', `subr', `compiled-function', `process', or
  828.      `window-configuration'.
  829.           (type-of 1)
  830.                => integer
  831.           (type-of 'nil)
  832.                => symbol
  833.           (type-of '())    ; `()' is `nil'.
  834.                => symbol
  835.           (type-of '(x))
  836.                => cons
  837. File: elisp,  Node: Equality Predicates,  Prev: Type Predicates,  Up: Lisp Data Types
  838. Equality Predicates
  839. ===================
  840.    Here we describe two functions that test for equality between any two
  841. objects.  Other functions test equality between objects of specific
  842. types, e.g., strings.  For these predicates, see the appropriate chapter
  843. describing the data type.
  844.  - Function: eq OBJECT1 OBJECT2
  845.      This function returns `t' if OBJECT1 and OBJECT2 are the same
  846.      object, `nil' otherwise.  The "same object" means that a change in
  847.      one will be reflected by the same change in the other.
  848.      `eq' returns `t' if OBJECT1 and OBJECT2 are integers with the same
  849.      value.  Also, since symbol names are normally unique, if the
  850.      arguments are symbols with the same name, they are `eq'.  For
  851.      other types (e.g., lists, vectors, strings), two arguments with
  852.      the same contents or elements are not necessarily `eq' to each
  853.      other: they are `eq' only if they are the same object.
  854.      (The `make-symbol' function returns an uninterned symbol that is
  855.      not interned in the standard `obarray'.  When uninterned symbols
  856.      are in use, symbol names are no longer unique.  Distinct symbols
  857.      with the same name are not `eq'.  *Note Creating Symbols::.)
  858.           (eq 'foo 'foo)
  859.                => t
  860.           
  861.           (eq 456 456)
  862.                => t
  863.           
  864.           (eq "asdf" "asdf")
  865.                => nil
  866.           
  867.           (eq '(1 (2 (3))) '(1 (2 (3))))
  868.                => nil
  869.           
  870.           (setq foo '(1 (2 (3))))
  871.                => (1 (2 (3)))
  872.           (eq foo foo)
  873.                => t
  874.           (eq foo '(1 (2 (3))))
  875.                => nil
  876.           
  877.           (eq [(1 2) 3] [(1 2) 3])
  878.                => nil
  879.           
  880.           (eq (point-marker) (point-marker))
  881.                => nil
  882.  - Function: equal OBJECT1 OBJECT2
  883.      This function returns `t' if OBJECT1 and OBJECT2 have equal
  884.      components, `nil' otherwise.  Whereas `eq' tests if its arguments
  885.      are the same object, `equal' looks inside nonidentical arguments
  886.      to see if their elements are the same.  So, if two objects are
  887.      `eq', they are `equal', but the converse is not always true.
  888.           (equal 'foo 'foo)
  889.                => t
  890.           
  891.           (equal 456 456)
  892.                => t
  893.           
  894.           (equal "asdf" "asdf")
  895.                => t
  896.           (eq "asdf" "asdf")
  897.                => nil
  898.           
  899.           (equal '(1 (2 (3))) '(1 (2 (3))))
  900.                => t
  901.           (eq '(1 (2 (3))) '(1 (2 (3))))
  902.                => nil
  903.           
  904.           (equal [(1 2) 3] [(1 2) 3])
  905.                => t
  906.           (eq [(1 2) 3] [(1 2) 3])
  907.                => nil
  908.           
  909.           (equal (point-marker) (point-marker))
  910.                => t
  911.           
  912.           (eq (point-marker) (point-marker))
  913.                => nil
  914.      Comparison of strings is case-sensitive and takes account of text
  915.      properties as well as the characters in the strings.  To compare
  916.      two strings' characters without comparing their text properties,
  917.      use `string=' (*note Text Comparison::.).
  918.           (equal "asdf" "ASDF")
  919.                => nil
  920.      Two distinct buffers are never `equal', even if their contents are
  921.      the same.
  922.    The test for equality is implemented recursively, and circular lists
  923. may therefore cause infinite recursion (leading to an error).
  924. File: elisp,  Node: Numbers,  Next: Strings and Characters,  Prev: Lisp Data Types,  Up: Top
  925. Numbers
  926. *******
  927.    GNU Emacs supports two numeric data types: "integers" and "floating
  928. point numbers".  Integers are whole numbers such as -3, 0, 7, 13, and
  929. 511.  Their values are exact.  Floating point numbers are numbers with
  930. fractional parts, such as -4.5, 0.0, or 2.71828.  They can also be
  931. expressed in exponential notation: 1.5e2 equals 150; in this example,
  932. `e2' stands for ten to the second power, and is multiplied by 1.5.
  933. Floating point values are not exact; they have a fixed, limited amount
  934. of precision.
  935.    Support for floating point numbers is a new feature in Emacs 19, and
  936. it is controlled by a separate compilation option, so you may encounter
  937. a site where Emacs does not support them.
  938. * Menu:
  939. * Integer Basics::            Representation and range of integers.
  940. * Float Basics::          Representation and range of floating point.
  941. * Predicates on Numbers::     Testing for numbers.
  942. * Comparison of Numbers::     Equality and inequality predicates.
  943. * Numeric Conversions::          Converting float to integer and vice versa.
  944. * Arithmetic Operations::     How to add, subtract, multiply and divide.
  945. * Rounding Operations::       Explicitly rounding floating point numbers.
  946. * Bitwise Operations::        Logical and, or, not, shifting.
  947. * Math Functions::            Trig, exponential and logarithmic functions.
  948. * Random Numbers::            Obtaining random integers, predictable or not.
  949.